<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('main/index');
//});

/**
 * 前台路由指向
 */
Route::group(['namespace' => 'Main'], function () {
    #首页
    Route::get('/', 'IndexController@index');

    #关于我们
    Route::get('about/{id}','AboutController@index');

    #联系我们
    Route::get('contact/{id}','ContactController@index');

    #工作机会
    Route::Get('work','WorkController@index');

    #服务理念
    Route::get('idea/{id}','IndexController@idea');

    #新闻列表页
    Route::get('news/{cid}','NewsController@newsList');
    #新闻详情
    Route::get('news/detail/{id}','NewsController@detail');

    #服务类别列表页
    Route::get('serviceList/{cid}','ServiceController@serviceList');
    #服务详情页
    Route::get('service/detail/{id}','ServiceController@detail');

    #搜索
    Route::get('search','IndexController@search');
});

/**
 * 后台路由指向
 */
Route::group(['prefix' => 'manage', 'namespace' => 'Manage'], function () {
        Route::get('login', 'ManageController@login');
        Route::get('captcha', 'ManageController@captcha');
        Route::post('login', 'ManageController@verify');
    }
);

/**
 * 系统配置管理
 */
Route::group(['prefix' => 'manage', 'namespace' => 'Manage', 'middleware' => 'manage'], function() {
        #首页
        Route::get('/', 'IndexController@index');
        Route::get('index', 'IndexController@index');

        #系统配置
            #设置系统配置状态
            Route::get('config/status', 'ConfigController@setStatus');
            #系统配置
            Route::resource('config','ConfigController');

        #管理员
            #注销
            Route::get('logout', 'ManageController@logout');
            #设置管理员状态
            Route::get('user/status', 'UserController@setStatus');
            #管理员列表页
            Route::get('user','UserController@index');
            #载入添加页
            Route::get('user/create','UserController@create');
            #提交数据
            Route::post('user/store','UserController@store');
            #载入修改页
            Route::get('user/{id}/edit','UserController@edit');
            #修改数据
            Route::post('user/update/{id}','UserController@update');
            #删除管理员
            Route::get('user/delete','UserController@destroy');
            #载入修改密码页
            Route::get('password','UserController@password');
            #修改密码
            Route::post('change_pass','UserController@change_pass');

        #关于我们
            #设置模块状态
            Route::get('about/status', 'AboutController@status');
            #关于我们列表页
            Route::get('about','AboutController@index');
            #载入添加页
            Route::get('about/create','AboutController@create');
            #提交数据
            Route::post('about/store','AboutController@store');
            #载入修改页
            Route::get('about/{id}/edit','AboutController@edit');
            #修改数据
            Route::post('about/update/{id}','AboutController@update');
            #删除关于我们
            Route::get('about/delete','AboutController@destroy');

        #服务分类管理
            #服务分类状态管理
            Route::get('service_category/status','ServiceCategoryController@status');
            #服务分类列表页
            Route::get('service_category','ServiceCategoryController@index');
            #载入添加页
            Route::get('service_category/create','ServiceCategoryController@create');
            #提交服务分类数据
            Route::post('service_category/store','ServiceCategoryController@store');
            #载入修改页
            Route::get('service_category/{id}/edit','ServiceCategoryController@edit');
            #修改服务分类数据
            Route::post('service_category/update/{id}','ServiceCategoryController@update');
            #删除服务分类
            Route::get('service_category/delete','ServiceCategoryController@destroy');

        #服务文章管理
            #文章状态管理
            Route::get('service/status','ServiceController@status');
            #置顶操作
            Route::get('service/topStatus','ServiceController@topStatus');
            #推荐操作
            Route::get('service/recommStatus','ServiceController@recommStatus');
            #文章列表页
            Route::get('service','ServiceController@index');
            #载入添加页
            Route::get('service/create','ServiceController@create');
            #提交文章数据
            Route::post('service/store','ServiceController@store');
            #载入修改页
            Route::get('service/{id}/edit','ServiceController@edit');
            #修改文章数据
            Route::post('service/update/{id}','ServiceController@update');
            #删除文章
            Route::get('service/delete','ServiceController@destroy');

        #服务理念
            #文章状态管理
            Route::get('idea/status','IdeaController@status');
            #理念列表页
            Route::get('idea','IdeaController@index');
            #理念修改
            Route::get('idea/{id}/edit','IdeaController@edit');
            #修改理念数据
            Route::post('idea/update/{id}','IdeaController@update');
            #删除理念
            Route::get('idea/delete','IdeaController@destroy');

        #合作伙伴
            #合作伙伴状态管理
            Route::get('partner/status','PartnerController@status');
            #合作伙伴列表页
            Route::get('partner','PartnerController@index');
            #合作伙伴修改
            Route::get('partner/{id}/edit','PartnerController@edit');
            #修改合作伙伴数据
            Route::post('partner/update/{id}','PartnerController@update');
            #合作伙伴理念
            Route::get('partner/delete','PartnerController@destroy');

        #优质案例
            #案例状态管理
            Route::get('cases/status','CasesController@status');
            #案例列表页
            Route::get('cases','CasesController@index');
            #案例修改
            Route::get('cases/{id}/edit','CasesController@edit');
            #修改案例数据
            Route::post('cases/update/{id}','CasesController@update');
            #删除案例
            Route::get('cases/delete','CasesController@destroy');

        #新闻分类管理
            #新闻分类状态管理
            Route::get('news_category/status','NewsCategoryController@status');
            #新闻分类列表页
            Route::get('news_category','NewsCategoryController@index');
            #载入添加页
            Route::get('news_category/create','NewsCategoryController@create');
            #提交新闻分类数据
            Route::post('news_category/store','NewsCategoryController@store');
            #载入修改页
            Route::get('news_category/{id}/edit','NewsCategoryController@edit');
            #修改新闻分类数据
            Route::post('news_category/update/{id}','NewsCategoryController@update');
            #删除新闻分类
            Route::get('news_category/delete','NewsCategoryController@destroy');

        #新闻媒体
            #新闻状态管理
            Route::get('news/status','NewsController@status');
            #置顶操作
            Route::get('news/topStatus','NewsController@topStatus');
            #推荐操作
            Route::get('news/recommStatus','NewsController@recommStatus');
            #新闻列表页
            Route::get('news','NewsController@index');
            #载入添加页
            Route::get('news/create','NewsController@create');
            #提交文章数据
            Route::post('news/store','NewsController@store');
            #新闻修改
            Route::get('news/{id}/edit','NewsController@edit');
            #修改新闻数据
            Route::post('news/update/{id}','NewsController@update');
            #删除新闻
            Route::get('news/delete','NewsController@destroy');

        #工作机会
            #工作状态管理
            Route::get('work/status','WorkController@status');
            #工作列表页
            Route::get('work','WorkController@index');
            #工作修改
            Route::get('work/{id}/edit','WorkController@edit');
            #修改工作数据
            Route::post('work/update/{id}','WorkController@update');
            #删除工作
            Route::get('work/delete','WorkController@destroy');

        #联系我们
            #联系状态管理
            Route::get('contact/status','ContactController@status');
            #联系列表页
            Route::get('contact','ContactController@index');
            #联系修改
            Route::get('contact/{id}/edit','ContactController@edit');
            #修改联系数据
            Route::post('contact/update/{id}','ContactController@update');
            #删除联系
            Route::get('contact/delete','ContactController@destroy');
    }
);

/**
 * Test
 */
Route::group(['prefix' => 'test', 'namespace' => 'Test'], function () {
    Route::get('access_token', 'WechatController@accessToken');
    Route::get('server', 'WechatController@server');
}
);